package com.study.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.study.model.mdao.ReciprocatingUnitMapper;
import com.study.model.pojo.ReciprocatingUnit;

@Service
@Transactional(rollbackFor = Exception.class)
public class ReciprocatingUnitServices {
	@Autowired
	ReciprocatingUnitMapper rumDao;

	public List<ReciprocatingUnit> selectAll() {
		return rumDao.getAllInfo();
	}

	public ReciprocatingUnit selectById(String recId) {
		return rumDao.getInfoById(recId);
	}

	public List<ReciprocatingUnit> selectAllPaging(int startPageNum, int everyPageNum) {
		return rumDao.getAllInfoPaging(startPageNum, everyPageNum);
	}

	public int selectCount() {
		return rumDao.getCount();
	}

	public List<ReciprocatingUnit> selectAllByKeywords(String keywords) {
		return rumDao.getRecByKeywords(keywords);
	}

	public int insertRec(ReciprocatingUnit reciprocatingUnit) {
		return rumDao.addNewRec(reciprocatingUnit);
	}

	public int updataRec(ReciprocatingUnit reciprocatingUnit) {
		return rumDao.updataRec(reciprocatingUnit);
	}
}
